_package("mvcdemo.page");

_import("caf.ui.Page");

_class("HomePage", MVCPageBase, function(){

	this._init = function(){
		_super._init.call(this);

		//需要进行手动关联
		this.MVC(HomeModel,HomeRender);
	};

	this.create = function(parent){
		var obj = this.createTplElement(parent, "home.xml");
		this.init(obj);
		return obj;
	};

	this.init = function(){
		_super.init.apply(this, arguments);
		this.initComponents();
		this.initActionElements();
	};

	this.reset = function(){
		_super.reset.apply(this, arguments);
	};

	this.dispose = function(){
		_super.dispose.apply(this);
	};

	this.do_setKey = function(){
		var key = $E("txtKey").value;
		this.getList(key);
	};

	this.getList = function(key){
		this._model.setKeyWords(key)
		var _this = this;
		this._model.getList(function(data){
			_this._render.renderList(data);
		});
	};
});